// web/src/app/(employee)/_components/sidebar-routes.tsx
'use client';
import React from 'react';
import Link from "next/link";
import {BarChart, Compass, InfoIcon, Layout, List} from "lucide-react";
import {usePathname} from "next/navigation";
import SidebarItem from "@/app/(employee)/_components/sidebar-item";
import {IoShareSocialOutline} from "react-icons/io5";
import {MdForum} from "react-icons/md";
import {SiFuturelearn, SiGreatlearning, SiScikitlearn, SiSololearn, SiTheboringcompany} from "react-icons/si";


const guestRoutes = [
    {
        icon: Layout,
        label: "首页",
        href: '/',
    },
    // {
    //     icon: Compass,
    //     label: "Browse",
    //     href: '/search'
    // },
    {
        icon: IoShareSocialOutline,
        label: '群组',
        href: '/social',
    },
    {
        icon: MdForum,
        label: '社区',
        href: '/forum',
    },
    {
        icon: SiSololearn,
        label: '课程',
        href: '/learn',
    },
    {
        icon: SiSololearn,
        label: '模拟面试',
        href: '/meet/virtual',
    },
]

const companyRoutes = [
    {
        icon: List,
        label: "Courses",
        href: '/company-side/'
    },
    {
        icon: BarChart,
        label: "Analytics",
        href: '/company-side/analytics'
    },
    {
        icon: InfoIcon,
        label: "CompanyInfo",
        href: '/company-side/company'
    }
]

const SidebarRoutes = () => {
    const pathname = usePathname()
    // 企业端
    const isCompanyPage = pathname?.startsWith('/company-side')
    const routes = isCompanyPage ? companyRoutes : guestRoutes

    return (
        <div className={`flex flex-col w-full`}>
            {routes.map(r => (
                <SidebarItem
                    key={r.href}
                    icon={r.icon}
                    href={r.href}
                    label={r.label}
                />
            ))}
        </div>
    );
};

export default SidebarRoutes;